$(".get2 ul li").click(function () {
    $(this).css({
        "border": "1px solid #ec5051"
    });
    $(this).children().css({
        "color": "#ec5051"
    })
    $(this).parent().prev().css({
        "border": "1px solid #Fff"
    });
    $(this).parent().prev().children().css({
        "color": "#3a78bf"
    })
    $(this).siblings().css({
        "border": "1px solid #Fff"
    });
    $(this).siblings().children().css({
        "color": "#3a78bf"
    })
})
$(".get2 div:nth-child(2)").click(function () {
    $(this).css({
        "border": "1px solid red",
        "color": "#ec5051"
    });
    $(this).children().css({
        "color": "#ec5051"
    })
    $(this).next().children().css({
        "border": "1px solid #Fff",
    });
    $(this).next().children().children().css({
        "color": "#3a78bf"
    })
})

$(".get2:nth-child(1) div:nth-child(2)").click(function () {
    $(this).css({
        "border": "1px solid red",
        "color": "#ec5051"
    });
    $(this).children().css({
        "color": "#ec5051"
    })
    $(this).next().children().css({
        "border": "1px solid #Fff",
    });
    $(this).next().children().children().css({
        "color": "#3a78bf"
    })
    $(".get2:nth-child(2) div:nth-child(2)").css({
        "border": "1px solid #fff",
    }).children().css({
        "color": "#3a78bf"
    })
    
    console.log($(".get2:nth-child(2) ul li:nth-child(1)"));

    $(".get2:nth-child(2) ul li:nth-child(1)").css({
        "border": "1px solid #ec5051",
    }).children().css({
        "color": "#ec5051"
    })
    $(".get2:nth-child(2) ul li:nth-child(1)").siblings().css({
        "border": "1px solid #fff",
    }).children().css({
        "color": "#3a78bf"
    })


    $(".border").css({
        "display": "block"
    }).next().css({
        "display": "none"
    })










 


    $(".border ul li").remove()


    $($(obj.yvsho)[0]).each(function (g, h) {
        var hh = h.quanbu.sort(function(a,b){
            return(b.price-a.price);
        });
            for (let a = 0; a < hh.length; a++) {
                var mn = hh[a].imgUrl.split(".");
                var mn1 = "." + mn[1] + mn[2] + "." + mn[3]
                var mn2 = hh[a].price;
                var mn3 = hh[a].price1;
                var mn4 = hh[a].name;
                var mn5 = hh[a].people;
                $(".border1 ul").append(`
                 <li>
                     <div>
                         <a herf="">
                             <img src="${mn1}"></img>
                         </a>
                     </div>
                     <div>
                         <span><em>¥</em><span>${mn2}</span></span>
                         <del><em>¥</em><span>${mn3}</span></del>
                     </div>
                     <div>
                         <a href="" title="${mn4}">${mn4}</a>
                     </div>
                     <div>
                         <div>
                             已结束
                         </div>
                         <span>已有<em>${mn5}</em>人预约</span>
                     </div>
                 </li>
            `)
            }
         }
    )

});

$(".get1 .get2:nth-child(1) ul li").each(function (e, f) {
    $(f).click(function () {
        $(".border ul li").remove()

        $($(obj.yvsho)[e + 1]).each(function (g, h) {
            for (var q in h) {
                if (h[q].length == 0) {

                    $(".border").css({
                        "display": "none"
                    }).next().css({
                        "display": "block"
                    })

                } else {
                    $(".border").css({
                        "display": "block"
                    }).next().css({
                        "display": "none"
                    })

                    for (let a = 0; a < h[q].length; a++) {
                        var mn = h[q][a].imgUrl.split(".");
                        var mn1 = "." + mn[1] + mn[2] + "." + mn[3]
                        var mn2 = h[q][a].price;
                        var mn3 = h[q][a].price1;
                        var mn4 = h[q][a].name;
                        var mn5 = h[q][a].people;
                        $(".border1 ul").append(`
                 
                         <li>
                             <div>
                                 <a>
                                     <img src="${mn1}"></img>
                                 </a>
                             </div>
                             <div>
                                 <span><em>¥</em><span>${mn2}</span></span>
                                 <del><em>¥</em><span>${mn3}</span></del>
                             </div>
                             <div>
                                 <a href="" title="${mn4}">${mn4}</a>
                             </div>
                             <div>
                                 <div>
                                     已结束
                                 </div>
                                 <span>已有<em>${mn5}</em>人预约</span>
                             </div>
                         </li>
                  
                    `)

                    }



                }
            }
        })



    })
})














var time = decodeURI(location.search.split("=")[1]);
$(".get2 ul li:contains(" + time + ")").css({
    "border": "1px solid red"
}).children().css({
    "color": "#ec5051"
})


var time1 = $(".get2 ul li:contains(" + time + ")").index();
$($(obj.yvsho)[time1 + 1]).each(function (g, h) {
    for (var q in h) {
        if (h[q].length == 0) {

            $(".border").css({
                "display": "none"
            }).next().css({
                "display": "block"
            })
        } else {
            $(".border").css({
                "display": "block"
            }).next().css({
                "display": "none"
            })
            for (let a = 0; a < h[q].length; a++) {
                var mn = h[q][a].imgUrl.split(".");
                var mn1 = "." + mn[1] + mn[2] + "." + mn[3]
                var mn2 = h[q][a].price;
                var mn3 = h[q][a].price1;
                var mn4 = h[q][a].name;
                var mn5 = h[q][a].people;
                var mn6= mn1+"&"+mn2+"&"+mn3+"&"+mn4+"&"+mn5
                $(".border1 ul").append(`
         
                 <li>
                     <div>
                         <a href="./预售首页.html?${mn6}">
                             <img src="${mn1}"></img>
                         </a>
                     </div>
                     <div>
                         <span><em>¥</em><span>${mn2}</span></span>
                         <del><em>¥</em><span>${mn3}</span></del>
                     </div>
                     <div>
                         <a href="" title="${mn4}">${mn4}</a>
                     </div>
                     <div>
                         <div>
                             已结束
                         </div>
                         <span>已有<em>${mn5}</em>人预约</span>
                     </div>
                 </li>
          
            `)


            }



        }
    }
})

























// $($(obj.yvsho)[time1 + 1]).each(function (g, h) {
//     for (var q in h) {
//         if (h[q].length == 0) {

//             $(".border").css({
//                 "display": "none"
//             }).next().css({
//                 "display": "block"
//             })
//         } else {
//             $(".border").css({
//                 "display": "block"
//             }).next().css({
//                 "display": "none"
//             })
//             for (let a = 0; a < h[q].length; a++) {
//                 var mn = h[q][a].imgUrl.split(".");
//                 var mn1 = "." + mn[1] + mn[2] + "." + mn[3]
//                 var mn2 = h[q][a].price;
//                 var mn3 = h[q][a].price1;
//                 var mn4 = h[q][a].name;
//                 var mn5 = h[q][a].people;
//                 $(".border1 ul").append(`
         
//                  <li>
//                      <div>
//                          <a>
//                              <img src="${mn1}"></img>
//                          </a>
//                      </div>
//                      <div>
//                          <span><em>¥</em><span>${mn2}</span></span>
//                          <del><em>¥</em><span>${mn3}</span></del>
//                      </div>
//                      <div>
//                          <a href="" title="${mn4}">${mn4}</a>
//                      </div>
//                      <div>
//                          <div>
//                              已结束
//                          </div>
//                          <span>已有<em>${mn5}</em>人预约</span>
//                      </div>
//                  </li>
          
//             `)

//             }



//         }
//     }
// })
